﻿using System;
using HYCodeBase.Geometry;
using HYCodeBase.TopologySuite;

namespace HYRevitCode.RevitTopologySuite
{
	public class RevitPolygonRelateOperater
	{
		public bool TryGetPolygonRelate(RevitPolygonDataBean inputOne, RevitPolygonDataBean inputTwo, out TopologyRelateKindEnum relateResult)
		{
			relateResult = TopologyRelateKindEnum.Contains;
			HYPolygon inputPolygonOne = null;
			HYPolygon inputPolygonTwo = null;
			return GeometryTransformer.TryMakeHYPolygon(inputOne, out inputPolygonOne, inputOne.UsePrecisionDegree) && GeometryTransformer.TryMakeHYPolygon(inputTwo, out inputPolygonTwo, inputTwo.UsePrecisionDegree) && new HYPolygonRelateOperater().TryGetGeometryRelate(inputPolygonOne, inputPolygonTwo, out relateResult);
		}
	}
}
